package cn.iocoder.yudao.module.promotion.redpacket.pojo.po;

import cn.iocoder.yudao.framework.business.basic.pojo.po.MerchantScopeEntity;
import cn.iocoder.yudao.framework.validation.InEnumValue;
import cn.iocoder.yudao.module.api.promotion.redpacket.enums.RedPacketDiscountModeEnum;
import cn.iocoder.yudao.module.api.promotion.redpacket.enums.RedPacketTypeEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalTime;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 数据库表实体
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/06/21
 */
@Data
@TableName("promotion_red_packet_activity")
@Schema(description = "红包活动规则")
public class RedPacketActivity extends MerchantScopeEntity {

    @Schema(description = "红包类型：1早餐红包、2午餐红包、3晚餐红包")
    @InEnumValue(RedPacketTypeEnum.class)
    private Integer type;
    @TableField(exist = false)
    private String typeName;

    public String getTypeName() {
        return RedPacketTypeEnum.getNameByValue(getType());
    }

    @Schema(description = "开始时间")
    private LocalTime startTime;

    @Schema(description = "结束时间")
    private LocalTime endTime;

    @Schema(description = "门槛金额，单位为分")
    private Integer thresholdPrice;

    @Schema(description = "抵扣模式：0固定金额、1有多少抵扣多少")
    @InEnumValue(RedPacketDiscountModeEnum.class)
    private Integer discountMode;

    @Schema(description = "抵扣金额，单位为分")
    private Integer discountPrice;

    @Schema(description = "开关(0关闭,1开启)")
    private Boolean enable;
}
